// Package snowflake
/*
@Coding : utf-8
@Time : 2023/3/11 22:53
@Author : yizhigopher
@Software : GoLand
*/
package snowflake

import (
	"github.com/bwmarrin/snowflake"
	"time"
)

var (
	node *snowflake.Node
)

func init() {
	var st time.Time
	startTime := "2023-01-02"
	st, _ = time.Parse("2006-01-02", startTime)

	snowflake.Epoch = st.UnixNano() / 1e6
	node, _ = snowflake.NewNode(1)
}

func MakeID() string {
	return node.Generate().Base64()
}
